
# ifndef __DFX_TEXTURE_OGL_H__
# define __DFX_TEXTURE_OGL_H__

# include <GL/glew.h>
# include <GL/GL.h>

# include "dfxTexture.h"

namespace DFX
{
    class Texture_OGL : public Texture
    {
    private:

        GLuint	mHandle;
        GLuint	mTarget;

    public:

        Texture_OGL(const String &name, GraphicsDevice *gd, TEXTURE_TYPE type, UInt32 usage, bool mipMaps);
        ~Texture_OGL();

        GLuint GetHandle() const
        {
            return mHandle;
        }

        GLuint GetTarget() const
        {
            return mTarget;
        }

        DFXRESULT Load2D(Image *img);
        DFXRESULT LoadCube(const ImageArray &images);

        DFXRESULT Create(SURFACE_FORMAT format, UInt32 width, UInt32 height, UInt32 depth);
        DFXRESULT Destroy();

        void SetFilter(TEXTURE_FILTER filter);
        void SetAnisotropy(Float32 anisotropy);

        void SetWrapS(TEXTURE_WRAP wrapS);
        void SetWrapT(TEXTURE_WRAP wrapT);
        void SetWrapR(TEXTURE_WRAP wrapR);       
    };
}

# endif